﻿using IPC.Communication;
using IPC.ListConnect.Connect;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IPC.WinForm.Controller
{
    [ApiController]
    [Route("[controller]")]
    public class TestController : ControllerBase
    {
        /// <summary>
        /// 按组读
        /// </summary>
        /// <param name="connectName">通道名</param>
        /// <param name="equipName">设备名</param>
        /// <param name="groupName">组名（可以不传）</param>
        /// <returns></returns>
        [HttpGet(Name = "GetTestRead")]
        public string Get(string connectName, string equipName, string groupName = "")
        {
            VirtualConnect virtualConnect = new VirtualConnect(connectName, "", 0, 0, 0);
            string json = virtualConnect.ReadJson(connectName, equipName, groupName);
            return json;
        }
    }
}
